namespace(:db) do
desc "Creates the first admin account for the software"
task(:createadmin => :environment) do
    admin = Administrator.new
    admin.name = "Peppino"
    admin.surname = "Mascalippa"
    admin.phonenumber = "0997897"
    admin.account = Account.new
    admin.account.login = "admin"
    admin.account.email = "prova@prova.org"
    admin.account.password = "prova"
    admin.account.password_confirmation = "prova"
    if admin.save
      puts "Admin created, these are the credentials"
      puts "login: admin"
      puts "password: prova"
    else
      puts "Error: there was an error while creating a new administrator..."
    end
end
end